<h3> DS Crawler</h3>

<div>
<h4> Crawler Finished</h4>
<table class="table-3">
	<thead>
		<th> Name </th> <th> Depth </th> <th> Created_at </th> <th> Started at </th> <th>Finished at</th> <th> Action </th>
	</thead>
	<tbody>
		<?php if($this->crawler_finished):?>
			<?php foreach($this->crawler_finished as $crawler):?>
				<tr>
					<td><a class="menu" href="#<?php echo $crawler->id ?>"><?php echo $this->escape($crawler->name);?></a></td>
					<td><?php echo $this->escape($crawler->depth);?></td>
					<td><?php echo $this->escape($crawler->created_at);?></td>
					<td><?php echo $this->escape($crawler->started_at);?></td>
					<td><?php echo $this->escape($crawler->finished_at);?></td>
					<td> 
						<a href="#" onclick="crawler_view_websites(<?php echo $crawler->id ?>);return;">View List Website</a>
						<a href="#" onclick="crawler_get_url(<?php echo $crawler->id ?>)">Crawl - Get URL (1)</a>
						<a href="#" onclick="crawler_get_kw(<?php echo $crawler->id ?>)">Crawl - Get KW (2)</a>
						<a class="menu" href="#<?php echo $crawler->id ?>" >More</a>
					</td>
				</tr>
			<?php endforeach;?>
		<?php endif;?>
	</tbody>
</table>
<br/>
<h4> Crawler NOT Finished</h4>
<table class="table-3">
	<thead>
		<th> Name </th> <th> Depth </th> <th> Created_at </th> <th> Started at </th> <th>Finished at</th> <th> Action </th>
	</thead>
	<tbody>
		<?php if($this->crawlers):?>
			<?php foreach($this->crawlers as $crawler):?>
				<tr>
					<td><a href="#<?php echo $crawler->id ?>"><?php echo $this->escape($crawler->name);?></a></td>
					<td><?php echo $this->escape($crawler->depth);?></td>
					<td><?php echo $this->escape($crawler->created_at);?></td>
					<td><?php echo $this->escape($crawler->started_at);?></td>
					<td><?php echo $this->escape($crawler->finished_at);?></td>
					<td> 
						<a href="#" onclick="crawler_view_websites(<?php echo $crawler->id ?>);return;">List Website</a>
						<a href="#" onclick="crawler_get_url(<?php echo $crawler->id ?>)">C- Get URL (1)</a>
						<a href="#" onclick="crawler_get_kw(<?php echo $crawler->id ?>)">C- Get KW (2)</a>
					</td>
				</tr>
			<?php endforeach;?>
		<?php endif;?>
	</tbody>
</table>

	
</div>

<script>

	var menu = {'update_ranking_kw':'Update Ranking Keyword', 'update_ranking_website':'Update Ranking Website','update_ranking_cate_website':'Update Ranking category website'};
	$(".menu").dContextMenu(menu, {'params':{'id':1,'b':2},'handle':'menu_handle'});

	
</script>
